package avicit.bdp.dms.tdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;



/** 
 * 我的应用表实体
 * 
 */
@ApiModel(value = "AppClientDTO", description = "我的应用表")
@Table(name = "bdp_asset_app_client")
public class AppClientDTO extends BaseDTO {

	/**
	* 主键
	*
	*/
	@Id
	@javax.persistence.Id
	@LogField
	@ApiModelProperty(value = "客户端ID")
	@FieldRemark(column = "client_id", field = "clientId", name = "客户端ID")
	@Column(name = "client_id")
	private String clientId;

	/**
	 * 客户端密码
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "客户端密码")
	@FieldRemark(column = "client_secret", field = "clientSecret", name = "客户端密码")
	@Column(name = "client_secret")
    private String clientSecret;
	/**
	 * 客户端名称
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "客户端名称")
	@FieldRemark(column = "client_name", field = "clientName", name = "客户端名称")
	@Column(name = "client_name")
    private String clientName;
	/**
	 * 客户端图标
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "客户端图标")
	@FieldRemark(column = "client_icon_uri", field = "clientIconUri", name = "客户端图标")
	@Column(name = "client_icon_uri")
    private String clientIconUri;
	/**
	 * 作用域
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "作用域")
	@FieldRemark(column = "scope", field = "scope", name = "作用域")
	@Column(name = "scope")
    private String scope;
	/**
	 * 授权方式
	 *
	 */
	@LogField
	@ApiModelProperty(value = "授权方式：签名方试--\n" +
			"client_credentials；\n" +
			"简易方式-easy_client")
	@FieldRemark(column = "grant_types", field = "grantTypes", name = "授权方式：签名方试--\n" +
			"client_credentials；\n" +
			"简易方式-easy_client")
	@Column(name = "grant_types")
	private String grantTypes;
	/**
	 * 授权方式
	 *
	 */
	@LogField
	@ApiModelProperty(value = "跳转路径")
	@FieldRemark(column = "redirect_uri", field = "redirectUri", name = "跳转路径")
	@Column(name = "redirect_uri")
	private String redirectUri;
	/**
	 * access_token有效期
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "access_token有效期")
	@FieldRemark(column = "access_token_validity", field = "accessTokenValidity", name = "access_token有效期")
	@Column(name = "access_token_validity")
    private Integer accessTokenValidity;
	/**
	 * refresh_token有效期
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "refresh_token有效期")
	@FieldRemark(column = "refresh_token_validity", field = "refreshTokenValidity", name = "refresh_token有效期")
	@Column(name = "refresh_token_validity")
    private Integer refreshTokenValidity;
	/**
	 * 备注
	 * 
	 */
	@LogField
	@ApiModelProperty(value = "备注")
	@FieldRemark(column = "description", field = "description", name = "备注")
	@Column(name = "description")
    private String description;
	/**
	 * 是否删除状态：0--正常；1--删除
	 *
	 */
	@LogField
	@ApiModelProperty(value = "是否删除状态：0--正常；1--删除")
	@FieldRemark(column = "archived", field = "archived", name = "是否删除状态：0--正常；1--删除")
	@Column(name = "archived")
    private Integer archived;

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public String getClientSecret() {
		return clientSecret;
	}

	public void setClientSecret(String clientSecret) {
		this.clientSecret = clientSecret;
	}

	public String getClientName() {
		return clientName;
	}

	public void setClientName(String clientName) {
		this.clientName = clientName;
	}

	public String getClientIconUri() {
		return clientIconUri;
	}

	public void setClientIconUri(String clientIconUri) {
		this.clientIconUri = clientIconUri;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getGrantTypes() {
		return grantTypes;
	}

	public void setGrantTypes(String grantTypes) {
		this.grantTypes = grantTypes;
	}

	public String getRedirectUri() {
		return redirectUri;
	}

	public void setRedirectUri(String redirectUri) {
		this.redirectUri = redirectUri;
	}

	public Integer getAccessTokenValidity() {
		return accessTokenValidity;
	}

	public void setAccessTokenValidity(Integer accessTokenValidity) {
		this.accessTokenValidity = accessTokenValidity;
	}

	public Integer getRefreshTokenValidity() {
		return refreshTokenValidity;
	}

	public void setRefreshTokenValidity(Integer refreshTokenValidity) {
		this.refreshTokenValidity = refreshTokenValidity;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getArchived() {
		return archived;
	}

	public void setArchived(Integer archived) {
		this.archived = archived;
	}

	@Override
	public String getLogFormName() {
		if (StringUtils.isEmpty(super.logFormName)) {
			return "数据资产-我的应用模块";
		} else {
			return super.logFormName;
		}
	}

	@Override
	public String getLogTitle() {
		if (StringUtils.isEmpty(super.logTitle)) {
			return "我的应用";
		} else {
			return super.logTitle;
		}
	}
}